package cn.iocoder.yudao.module.knowledge.dal.mysql.item;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.knowledge.dal.dataobject.item.ItemDetailDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.knowledge.controller.admin.item.vo.*;

/**
 * 知识库明细 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface BaseTreeDetailMapper extends BaseMapperX<ItemDetailDO> {

    default PageResult<ItemDetailDO> selectPage(ItemDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ItemDetailDO>()
                .betweenIfPresent(ItemDetailDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ItemDetailDO::getHtml, reqVO.getHtml())
                .orderByDesc(ItemDetailDO::getId));
    }

}